import type { RouteRecordRaw } from 'vue-router';

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    component: () => import('layouts/MainLayout.vue'),
    children: [
      { path: '', redirect: '/dashboard' },
      { path: 'dashboard', component: () => import('pages/DashboardPage.vue') },
      { path: 'analytics', component: () => import('pages/AnalyticsPage.vue') },
      { path: 'user-manage', component: () => import('pages/UserManagePage.vue') },
      {
        path: 'settings',
        component: () => import('pages/settings/SettingsLayout.vue'),
        children: [
          { path: 'profile', component: () => import('pages/settings/ProfilePage.vue') },
          { path: 'preferences', component: () => import('pages/settings/PreferencesPage.vue') },
        ],
      },
    ],
  },

  // Always leave this as last one,
  // but you can also remove it
  {
    path: '/:catchAll(.*)*',
    component: () => import('pages/ErrorNotFound.vue'),
  },
];

export default routes;
